<?php
require 'lib/PHPMailerAutoload.php';

$mail = new PHPMailer;

$mail->SMTPDebug = 3;                               // Enable verbose debug output

$mail->isSMTP();                                      // Set mailer to use SMTP
$mail->Host = 'mail.vistemail.com';  // Specify main and backup SMTP servers
$mail->SMTPAuth = true;                               // Enable SMTP authentication
$mail->SMTPSecure = 'tls';                            // Enable TLS encryption, `ssl` also accepted
$mail->Port = 25;//587;                                    // TCP port to connect to


$mail->Username = 'adam@vistemail.com';                            // SMTP username
$mail->Password = 'gvic57898';                           // SMTP password
                         // SMTP password

$mail->From = 'adam@vistemail.com';
$mail->FromName = 'Adam';


$mail->addAddress('gonzalezshopia@gmail.com');               // Name is optional

//$mail->addReplyTo('info@example.com', 'Information');

//$mail->AddCustomHeader("In-Reply-To: <CAAyyG7oXeNx_4Bq5Phmg50dp2bhukVzUe4xZnFiwkMcRij3+TQ@mail.gmail.com>");


//$mail->WordWrap = 50;                                 // Set word wrap to 50 characters
//$mail->addAttachment('/var/tmp/file.tar.gz');         // Add attachments
//$mail->addAttachment('/tmp/image.jpg', 'new.jpg');    // Optional name
$mail->isHTML(true);                                  // Set email format to HTML
$mail->Subject = 'Re: asdfsdf';
$mail->Body    = 'This is the HTML message body 1</b>';
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';

$socket = fsockopen("mail.vistemail.com", "25", $errno, $errstr,10); 
if($socket) 
{
    if(!$mail->send()) {
        echo 'Message could not be sent.';
        echo 'Mailer Error: ' . $mail->ErrorInfo;
    } else {
        echo 'Message has been sent';
    }
}
else {
    echo "connecttion failed.";
}
?>